package com.yawn.demomybatisxml.controller;

import com.yawn.demomybatisxml.entity.Book;
import com.yawn.demomybatisxml.mapper.BookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/book")
public class BookController {

    @Autowired
    private BookMapper bookMapper;

    @GetMapping("/find")
    List<Book> find(int ownerId) {
        return bookMapper.findByOwner(ownerId);
    }


}
